
{php include wl_template('common/header');}
<style>
	.box{margin-bottom: 10px;}
	.modal-dialog table{text-align: center;}
	.layer label{
		
	}
	
</style>
<script>
	function defined(orderno){ 
		var orderno=orderno;
 				$("#defined_title").html('<input type="hidden" id="orderno"  name="orderno" value="'+orderno+'" /><h3 style="margin-bottom:30px; text-align:center;">当前订单号： '+orderno+'</h3>'); 
				$('#modal-module-defined').modal();
	} 
	function update_subsidy(){ 
		var orderno = $("input[name='orderno']").val();
		var subsidy = $("input[name='subsidy']").val();

		$.ajax({
	             type: "GET",
	             url: "{php echo web_url('agent/subsidy',array('op' => 'defined_subsidy'))}",
	             data:{"orderno":orderno,'subsidy':subsidy},
				 dataType: "json",
	             success: function(data){	
	             	
					util.tips('发放成功！', 2000);
					setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
					window.location.reload();//页面刷新
					},1000);
					
				 }
	         });
	} 
</script>
<ul class="nav nav-tabs">
	
    <li{if $status == '0'} class="active"{/if}>
        <a href="{php echo web_url('agent/examine', array('op' => 'display', 'status' =>'0'))}">待审核 </a>
    </li>
  
</ul>
<div class="main">
    <div class="panel panel-info">
	    <div class="panel-heading">筛选</div>
	    <div class="panel-body">
            <form action="{php echo web_url('agent/examine')}" method="get" class="form-horizontal" role="form" id="form1">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="lexiangpingou" />
            <input type="hidden" name="do" value="agent" />
            <input type="hidden" name="ac" value="examine" />
            <input type="hidden" name="op" value="display" />

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">昵称</label>
                    <div class="col-sm-8 col-lg-9 col-xs-12">
                        <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}" placeholder="可查询昵称">
                    </div>
                </div>
                <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">申请时间</label>
                        <div class="col-sm-5 col-lg-7 col-xs-12">
                            {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
                        </div>
                        <div class="col-sm-3 col-lg-2" style="text-align:right;"><button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>
                <div class="form-group">
                </div>
            </form>
			
          <!--  <a href='{php echo $this->createWebUrl('grouporder', array('op' => 'output','groupstatus'=>$groupstatus,'starttime'=>$starttime,'endtime'=>$endtime))}'><button class="btn btn-info"><i class="fa fa-download"></i> 导出记录</button></a>-->
	    </div>
	</div>

	<div class="panel panel-default">
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead class="navbar-inner">
					<tr>
						<th style="width:15%;">订单号 </th>
						<th style="width:15%;">推荐公众号</th>
						<th style="width:10%;">订单类型</th>
						<th style="width:10%;">订单金额</th>
						<th style="width:10%;">提成金额</th>
						<th style="width:10%;">补贴金额</th>
						<th style="width:13%;">支付时间</th>							
						<th style="width:7%;">当前状态</th>
						<th style="width:10%;text-align: center;">操作</th>
					</tr>
				</thead>
				<tbody>
					{loop $log $item}

					<tr style="background-color: #fff; font-size: 12px;">
					<!--<td class="text-center" style="width:60px;"><input type="checkbox" name="checkbox[]"  value="{$item['id']}" /></td>-->
				
						<td class="" >
							<span>{$item['orderno']}</span>
						</td>
						<td class="" >
							<span>{$item['gzname']}</span>
						</td>
						<td class="" >
							<span>{$item['name']}</span>
						</td>
						<td class="" >
							<span>{$item['cash']}</span>
						</td>
						<td class="" >
							<span>{$item['refund_cash']}</span>
						</td>
						<td class="" >
							<span>{$item['subsidy_cash']}</span>
						</td>
						<td class="" >
							<span>{$item['ptime']}</span>
						</td>
						<td>
							{if $item['status']==0}
								<span class="label label-info">未提现</span>
							{/if}
							{if $item['status']==1 }
								 <span class="label label-primary">已提现</span>
							{/if}
						</td>
						<td style="text-align: center;">

							<button class="btn btn-default btn-xs" type="button" id="seekTel" onclick="defined('{$item['orderno']}')">发送补贴</button>
						</td>
					</tr>
					{/loop}
				</tbody>
			</table>
		</div>
	</div>
</div>
{$pager}

<div id="modal-module-defined" class="modal fade sc" tabindex="-1">
							<div class="modal-dialog" style='width:1000px; margin-bottom: 10%; height:85%;font-size: 14px; text-align: left; padding: 30px; '>
								<a class="closeBtn" style="position: absolute; top:40px; right:40px; z-index: 9999999;" data-dismiss="modal"><font color="ff0000">x</font></a>
								<div class="modal-content" style=" padding: 30px; ">
									<form action="" method="post" id="form2">
									<input type="hidden" name="c" value="site" />
						            <input type="hidden" name="a" value="entry" />
						            <input type="hidden" name="m" value="lexiangpingou" />
						            <input type="hidden" name="do" value="agent" />
						            <input type="hidden" name="ac" value="agent_users_admin" />
						            <input type="hidden" name="op" value="defined_vip" />
									<div id="defined_title">
									</div>
										<div class="panel-body" style="">
											<label class="col-md-2" style=" float: left; padding: 5px; ">补贴金额：</label>
											<div class="col-md-10" style="position:relative">
													<input class="form-control" name="subsidy" id="subsidy" placeholder="" >
											</div>
										</div>
										<p style="text-align: center; margin-top: 20px;">
											<button type="button" onclick="update_subsidy()" class="btn btn-primary" data-dismiss="modal">
		 										提交
		            					</button>
											<button type="button" class="btn btn-primary" data-dismiss="modal">
		 										取消
		            						</button>
		            						
										</p>
									
									</form>
								</div>
							</div>
						</div>

<script type="text/javascript">
	require(['daterangepicker'], function($){
		$('.daterange').on('apply.daterangepicker', function(ev, picker) {
			$('#form1')[0].submit() ;
		});
	});
</script>

{php include wl_template('common/footer');}